<!DOCTYPE html>
<html>

	<head>
		<title>Login</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<script type="application/x-javascript">
			addEventListener("load", function() {
				setTimeout(hideURLbar, 0);
			}, false);

			function hideURLbar() {
				window.scrollTo(0, 1);
			}
		</script>
		<meta name="keywords" content="Flat Dark Web Login Form Responsive Templates, Iphone Widget Template, Smartphone login forms,Login form, Widget Template, Responsive Templates, a Ipad 404 Templates, Flat Responsive Templates" />
		<link href="static/css/style.css" rel='stylesheet' type='text/css' />
		<script src="static/h-ui.admin/js/jquery-3.3.1.min.js"></script>
		<!--webfonts-->
		<!--<link href='http://fonts.useso.com/css?family=PT+Sans:400,700,400italic,700italic|Oswald:400,300,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.useso.com/css?family=Exo+2' rel='stylesheet' type='text/css'>-->
		<!--//webfonts-->
		<!--<script src="http://ajax.useso.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>-->
	</head>

	<body>
		<script>
			$(document).ready(function(c) {
				$('.close').on('click', function(c) {
					$('.login-form').fadeOut('slow', function(c) {
						$('.login-form').remove();
					})
				})
				$('#validate').click(function() {
					freshvalidate();
				})

				function freshvalidate() {
					var src = $('#validate').attr('src');
					src = src + '&';
					$('#validate').attr('src', src);
				}
				$('#login').click(function() {
//					alert(111);return false;
					var username = $('input[name=username]').val();
					var password = $('input[name=password]').val();
					var vali = $('input[name=vali]').val();
					var bool=$('input[name=remenber]').is(':checked')
//					alert(bool);return false;
					if(bool){
						var remenber = $('input[name=remenber]').val();
					}else{
						var remenber='';
					}
				
					$.post('index.php?a=admin&b=login&c=index', {
						'username': username,
						'password': password,
						'vali': vali,
						'remenber': remenber
					}, function(date) {
						if(date == 20000) {
							alert('验证码不正确');
							freshvalidate();
							return false;
						} else if(date == 20001) {
							alert('用户名或密码不正确');
							return false;
						} else if(date == 20002) {
							alert('登录成功');
							window.location = 'index.php?a=admin&b=welcome&c=index';
							return false;
						}
					})
					return false;
				})

			})
		</script>
		<!--SIGN UP-->
		<h1>后台管理系统</h1>
		<div class="login-form" style="margin-bottom: 40px;">
			<div class="close"> </div>
			<div class="head-info">
				<label class="lbl-1"> </label>
				<label class="lbl-2"> </label>
				<label class="lbl-3"> </label>
			</div>
			<div class="clear"> </div>
			<div class="avtar">
				<img src="static/images/avtar.png" />
			</div>
			<form action="index.php?a=admin&b=login&c=index" method="post">
				<input type="text" name="username" class="text" value="<?php if(!empty($_COOKIE['username'])){echo $_COOKIE['username'];}?>" />
				<div class="key">
					<input type="password" name="password" value="<?php if(!empty($_COOKIE['password'])){echo $_COOKIE['password'];}?>" />
				</div>
				<div class="remenber">
					<label style=" text-align: left;">记住我<input type="checkbox" value="on" name="remenber" <?php if(!empty($_COOKIE['username'])){echo 'checked=checked';}?>/></label>
					<label class="check" style="display: block; margin-bottom: 10px;">
			  			<input type="text" name="vali" id="vali" placeholder="请输入验证码" style="
						width: 30%;
			  			padding: 1em 2em 1em 3em;
			  			color: #9199aa;
			  			font-size: 18px;
			  			outline: none;
			  			border: none;
			  			font-weight: 100;
			  			border-bottom: 1px solid#484856;
			  			margin-top: 2em;"/>
	  				</label>
					<img id="validate" src="index.php?a=admin&b=login&c=validate" />
					<div/>
					<div class="signin">
						<input type="submit" value="Login" id="login">
					</div>
			</form>

			</div>

	</body>

</html>